<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const str = "abc123efg456";

      console.log(str.match(/[abc123]/g));
      console.log(str.match(/[0-3]/g)); //连续数字可以简写
      console.log(str.match(/[a-f]/g)); //连续字母可以简写
      console.log(str.match(/[a-f0-3]/g)); //[abcdef0123]
      console.log(str.match(/\d/g)); //[0-9]
      console.log(str.match(/\s/g)); //[\t\r\v\n]
      console.log(str.match(/\w/g)); //[0-9a-zA-Z_]
      console.log(str.match(/[\d\s]/g)); //

      // console.log(str.match(/\d/g));
      // console.log(str.match(/\w/g));
    </script>
  </body>
</html>
